//
//  BaseTableViewController.m
//  CLBrowser
//
//  Created by 梁慧聪 on 2017/4/8.
//  Copyright © 2021年 梁慧聪. All rights reserved.
//

#import "CLVCBaseTable.h"
@interface CLVCBaseTable ()

@property (nonatomic, assign) UITableViewStyle style;
@end
@implementation CLVCBaseTable
- (instancetype)initWithStyle:(UITableViewStyle)style
{
    if (self = [super init]) {
        self.style = style;
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.clearsSelectionOnViewWillAppear = NO;
    
    self.tableView.tableFooterView = [UIView new];
    self.tableView.estimatedRowHeight = 0;
    self.tableView.estimatedSectionHeaderHeight = 0;
    self.tableView.estimatedSectionFooterHeight = 0;
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    [self.navigationController setNavigationBarHidden:NO];
}

- (void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (UITableView *)tableView {
    if (!_tableView) {
        _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, CL_APPLICATION_TOP_BAR_HEIGHT, self.view.width, self.view.height - CL_APPLICATION_TOP_BAR_HEIGHT) style:self.style];
        self.tableView = _tableView;
        _tableView.delegate = self;
        _tableView.dataSource = self;
        _tableView.backgroundColor = [UIColor clearColor];
        [self.view addSubview:_tableView];
    }
    return _tableView;
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    return nil;
}

- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}


@end
